using System.Data.Entity;

namespace Zapi.Log.Db
{
    public partial class LogsEf : DbContext
    {
        public LogsEf()
            : base("name=LogsEf")
        {
        }

        public virtual DbSet<ApiLogs> ApiLogs { get; set; }
        public virtual DbSet<ELMAH_Error> ELMAH_Error { get; set; }
        public virtual DbSet<NLogs> NLogs { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<ApiLogs>()
                .Property(e => e.AppName)
                .IsUnicode(false);

            modelBuilder.Entity<ApiLogs>()
                .Property(e => e.AppVersionBuild)
                .IsUnicode(false);

            modelBuilder.Entity<ApiLogs>()
                .Property(e => e.Ip)
                .IsUnicode(false);

            modelBuilder.Entity<ApiLogs>()
                .Property(e => e.Method)
                .IsUnicode(false);

            modelBuilder.Entity<ApiLogs>()
                .Property(e => e.ClientVersion)
                .IsUnicode(false);

            modelBuilder.Entity<ApiLogs>()
                .Property(e => e.ClientName)
                .IsUnicode(false);

            modelBuilder.Entity<ApiLogs>()
                .Property(e => e.Lng)
                .HasPrecision(15, 12);

            modelBuilder.Entity<ApiLogs>()
                .Property(e => e.Lat)
                .HasPrecision(15, 12);

            modelBuilder.Entity<ApiLogs>()
                .Property(e => e.Device)
                .IsUnicode(false);

            modelBuilder.Entity<ApiLogs>()
                .Property(e => e.StatusCode)
                .IsUnicode(false);
        }
    }
}
